<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增人员绩效')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-achievements-add">
            <div class="form-group">
                <input name="userName" type="hidden" >
                <label class="col-sm-3 control-label is-required">选择员工：</label>
                <div class="col-sm-8">
                    <select name="userId" class="form-control" required>
                        <option th:each="item : ${userList}" th:text="${item.userName}" th:value="${item.userId}" ></option>
                    </select>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">绩效统计年月：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="achievementsDate" class="form-control" placeholder="yyyy-MM" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">全勤天数：</label>
                <div class="col-sm-8">
                    <input name="fullAttendanceDays" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">出勤天数：</label>
                <div class="col-sm-8">
                    <input name="attendanceDays" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">加班天数：</label>
                <div class="col-sm-8">
                    <input name="overtimeDays" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">绩效得分：</label>
                <div class="col-sm-8">
                    <input name="score" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">每件工资：</label>
                <div class="col-sm-8">
                    <input name="pieceMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产件数：</label>
                <div class="col-sm-8">
                    <input name="productionQuantity" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/achievements"
        $("#form-achievements-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $('input[name="userName"]').val($('select[name="userId"] option:selected').text())
                $.operate.save(prefix + "/add", $('#form-achievements-add').serialize());
            }
        }

        $("input[name='achievementsDate']").datetimepicker({
            format: "yyyy-mm",
            minView: 2,
            startView: 2,
            autoclose: true
        });
    </script>
</body>
</html>